package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the WAREHOUSE database table.
 * 
 */
@Entity
@NamedQuery(name="Warehouse.findAll", query="SELECT w FROM Warehouse w")
public class Warehouse implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="WHOUSE_ID")
	private long whouseId;

	@Column(name="WHOUSE_AGENT")
	private String whouseAgent;

	@Column(name="WHOUSE_NAME")
	private String whouseName;

	//bi-directional many-to-one association to EquipStorage
	@OneToMany(mappedBy="warehouse")
	private List<EquipStorage> equipStorages;

	//bi-directional many-to-one association to StockTakingId
	@OneToMany(mappedBy="warehouse")
	private List<StockTakingId> stockTakingIds;

	//bi-directional many-to-one association to OfficeFunction
	@ManyToOne
	@JoinColumn(name="OFFICE_FUNCTION_ID")
	private OfficeFunction officeFunction;

	//bi-directional many-to-one association to WhType
	@ManyToOne
	@JoinColumn(name="WTYPE_ID")
	private WhType whType;

	public Warehouse() {
	}

	public long getWhouseId() {
		return this.whouseId;
	}

	public void setWhouseId(long whouseId) {
		this.whouseId = whouseId;
	}

	public String getWhouseAgent() {
		return this.whouseAgent;
	}

	public void setWhouseAgent(String whouseAgent) {
		this.whouseAgent = whouseAgent;
	}

	public String getWhouseName() {
		return this.whouseName;
	}

	public void setWhouseName(String whouseName) {
		this.whouseName = whouseName;
	}

	public List<EquipStorage> getEquipStorages() {
		return this.equipStorages;
	}

	public void setEquipStorages(List<EquipStorage> equipStorages) {
		this.equipStorages = equipStorages;
	}

	public EquipStorage addEquipStorage(EquipStorage equipStorage) {
		getEquipStorages().add(equipStorage);
		equipStorage.setWarehouse(this);

		return equipStorage;
	}

	public EquipStorage removeEquipStorage(EquipStorage equipStorage) {
		getEquipStorages().remove(equipStorage);
		equipStorage.setWarehouse(null);

		return equipStorage;
	}

	public List<StockTakingId> getStockTakingIds() {
		return this.stockTakingIds;
	}

	public void setStockTakingIds(List<StockTakingId> stockTakingIds) {
		this.stockTakingIds = stockTakingIds;
	}

	public StockTakingId addStockTakingId(StockTakingId stockTakingId) {
		getStockTakingIds().add(stockTakingId);
		stockTakingId.setWarehouse(this);

		return stockTakingId;
	}

	public StockTakingId removeStockTakingId(StockTakingId stockTakingId) {
		getStockTakingIds().remove(stockTakingId);
		stockTakingId.setWarehouse(null);

		return stockTakingId;
	}

	public OfficeFunction getOfficeFunction() {
		return this.officeFunction;
	}

	public void setOfficeFunction(OfficeFunction officeFunction) {
		this.officeFunction = officeFunction;
	}

	public WhType getWhType() {
		return this.whType;
	}

	public void setWhType(WhType whType) {
		this.whType = whType;
	}

}